package com.siao.utils.net
{
	import com.siao.core.FlashPlayer;
	import com.siao.core.WebBrowser;
	
	import flash.external.ExternalInterface;
	import flash.net.URLRequest;
	import flash.net.navigateToURL;
	
	/**
	 * 打开链接地址
	 * @param url
	 * @param isBlank
	 * @return
	 */
	public function openURL(url:String, isBlank:Boolean=true):void
	{
		if (FlashPlayer.currentBrowser == WebBrowser.IE || FlashPlayer.currentBrowser == WebBrowser.Firefox)
		{
			if (isBlank)
			{
				ExternalInterface.call("window.open", url);
			}
			else
			{
				ExternalInterface.call("window.navigate", url);
			}
		}
		else
		{
			navigateToURL(new URLRequest(url), (isBlank) ? "_blank" : "_self");
		}
	}

}
